﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CoreOracle;
using System.Data.OracleClient;
using System.Data;

namespace gte
{
    class ORA_Fetch
    {
        public static void ExecSelect(DataTable dt, string id, string sql)
        {
            try
            {
                DB.Item.StartTransaction();
                OracleCommand cmd = new OracleCommand(sql, DB.Item.Connection, DB.Item.Transaction);
                OracleDataAdapter da = new OracleDataAdapter(cmd);
                da.Fill(dt);
                dt.PrimaryKey = new DataColumn[] { dt.Columns[id] };
                DB.Item.Commit();
            }
            catch
            {
                DB.Item.Rollback();
                throw;
            }
        }
    }
}
